/**
 * Created by YMP on 2019/10/7.
 */
// 省略号
@mixin line($num: 1) {
  overflow: hidden;
  text-overflow: ellipsis;

  @if ($num == 1) {
    white-space: nowrap;
  } @else {
    display: -webkit-box;
    -webkit-line-clamp: $num;

    /* autoprefixer: off */
    -webkit-box-orient: vertical;
  }
}
// 清除浮动
@mixin clearfix {
  &::after {
    clear: both;
    content: '';
    display: block;
  }
}

/**
 * 通用的遮罩
 */
@mixin overlay ($color:#000,$alpha: 0.3) {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: rgba($color, $alpha);
}

/***
* 背景图片地址和大小
 */
@mixin bis($url, $custom: 100%) {
  background-image: url($url);
  background-repeat: no-repeat;
  @if ($custom == 100%) {
    background-size: 100%;
  } @else {
    background-size: $custom;
  }
}

/**
*flex子元素
 */

@mixin flex-space ($space: center) {
  display: flex;
  align-items: center;
  @if ($space == between) {
    justify-content: space-between;
  } @else if($space == center) {
    justify-content: center;
  }@else if($space == around) {
    justify-content: space-around;
  }
}
//定位上下左右居中
@mixin center($position:absolute) {
  position: $position;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

//宽高
@mixin wh($width, $height) {
  width: $width;
  height: $height;
}

//字体大小，颜色
@mixin sc($size, $color) {
  font-size: $size;
  color: $color;
}
